<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>详情</title>
    <meta
      name="viewport"
      content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
    />
    <link href="../../../../css/mui.min.css" rel="stylesheet" />
    <link href="../../css/common.css" rel="stylesheet" />
    <link href="../../css/helper.css" rel="stylesheet" />
    <style>
      .mui-content {
        padding-top: 61px !important;
        padding-left: 13px;
        padding-right: 13px;
        margin-bottom: 15px;
      }
      .mui-content p {
        text-align: justify;
      }

      .file-pre-box {
        height: 443px;
        background: #f5f6f7;
        border: 1px solid #034880;
      }

      .file-pre {
        height: 443px;
        padding-left: 20px;
        padding-right: 20px;
        background: #f5f6f7;
        border: 1px solid #034880;
      }

      .img-tool-box {
        height: inherit;
        min-width: 33px;
      }

      .img-tool {
        width: 19px;
        height: 19px;
        margin-top: 10px;
      }
    </style>
  </head>

  <body>
    <div id="container" v-cloak>
      <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">详情</h1>
        <div class="img-tool-box">
          <img
            src="../../img/xiazai.png"
            class="img-tool fr"
            style="margin-left: 13px"
          />
          <img
            src="../../img/shoucang_moren.png"
            class="img-tool fr"
            style="margin-left: 13px"
          />
        </div>
      </header>
      <div class="mui-content">
        <p>
          描述：
          <br />
          {{detils.fileDescribe}}
        </p>
        <div class="file-pre">
          <h4 style="text-align: center">{{detils.title}}</h4>
          <div class="fileimg">
            <img :src="detils.fileAddres" alt="" />
          </div>
        </div>
      </div>
    </div>
    <script src="../../../../js/mui.js"></script>
    <script
      type="text/javascript"
      src="../../../../js/jquery-3.2.1.min.js"
    ></script>
    <script src="../../../../js/vue.js"></script>
    <script src="../../js/mkeyplus.base.js"></script>
    <script src="../../js/sqlite.js"></script>
    <script type="text/javascript">
      mui.init()
      var ids = 1
      var type = 1
      if (window.plus) {
        plusready()
      } else {
        document.addEventListener("plusready", plusready, false)
      }

      function plusready() {
        var self = plus.webview.currentWebview()
        console.log(self.ids)
        ids = self.ids
        vm.ids = self.ids
        type = self.type
        vm.type = self.type
        // vm.getDetils()
        // vm.getDetils(vm.ids)
        if (vm.type == 1) {
          vm.getDetils1()
        } else if (vm.type == 2) {
          vm.getDetils2()
        } else if (vm.type == 3) {
          vm.getDetils3()
        } else if (vm.type == 4) {
          vm.getDetils4()
        }
      }
      let vm = new Vue({
        el: "#container",
        data: {
          form: {
            page: 1,
            size: 20,
            system: "APP",
            status: 1,
          },
          ids: "",
          type: "",
          detils: {},
        },
        created: function () {},
        mounted() {
          if (this.type == 1) {
            this.getDetils1()
          } else if (this.type == 2) {
            this.getDetils2()
          } else if (this.type == 3) {
            this.getDetils3()
          } else if (this.type == 4) {
            this.getDetils4()
          }
        },
        methods: {
          // 标准
          getDetils1() {
            let than = this
            mui.baseApp.httpRequst(
              "post",
              "/app/api/knowledge/standard/detail/" + ids,
              {},
              function (data) {
                console.log("12", data.data)
                than.detils = data.data
                // plus.nativeUI.closeWaiting();
              },
              function () {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          // 设备
          getDetils2() {
            let than = this
            mui.baseApp.httpRequst(
              "get",
              "/app/api/knowledge/equipment/detail/" + ids,
              {},
              function (data) {
                console.log("12", data.data)
                than.detils = data.data
                // plus.nativeUI.closeWaiting();
              },
              function () {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          // 技术交流
          getDetils3() {
            let than = this
            mui.baseApp.httpRequst(
              "post",
              "/app/api/knowledge/experience/detail/" + ids,
              {},
              function (data) {
                console.log("12", data.data)
                than.detils = data.data
                // plus.nativeUI.closeWaiting();
              },
              function () {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
          // 故障
          getDetils4() {
            let than = this
            mui.baseApp.httpRequst(
              "post",
              "/app/api/knowledge/faultCase/detail/" + ids,
              {},
              function (data) {
                console.log("12", data.data)
                than.detils = data.data
                // plus.nativeUI.closeWaiting();
              },
              function () {
                // plus.nativeUI.closeWaiting()
                console.log("获取数据失败1")
              }
            )
          },
        },
      })
    </script>
  </body>
</html>
